<!--#include file="conn.asp"-->
<!--#include file="chkuser.asp"-->
<%
call adminRight(6)

	ID=request("ID")
	AllID=request("chk")

if request("action")="Del" then
	set rs=server.CreateObject("ADODB.RECORDSET")
	sql="Delete from OrderSub where ID="&ID
	conn.execute(sql)
	Go("?showMsgStr=<br><b>订单信息已删除成功！</b>|parent|3000|500||")
end if
if request("action")="delall" then
	If AllID="" Then Alert("没有选择数据"):GoBack():response.End()
	sql="delete from OrderSub where ID in("&AllID&")"
	conn.execute(sql)
	set rs=nothing
	Go("?showMsgStr=<br><b>订单信息已批量删除成功！</b>|parent|3000|500||")
end if
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>订单管理</title>
<link href="style.css" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript">
function selcheck(id) {
   var e =document.getElementById(id);
   var objs = e.getElementsByTagName("input");
   if (e.checked){
      e.checked = false;
      for(var i=0; i<objs.length; i++) {
         if(objs[i].type.toLowerCase() == "checkbox" )
         objs[i].checked = false;
      }
   }   else   {
      e.checked = true;
      for(var i=0; i<objs.length; i++) {
         if(objs[i].type.toLowerCase() == "checkbox" )
         objs[i].checked = true;
      }
   }
}
</script>
</head>
<body>
    <div id="frame_Toolbar" class="toolbarBg"> 
		<a href="javascript:self.history.back();" class="icoBtn_ct"><span class="btnIco btnBack"></span>返回</a> 
		<a href="javascript:self.location.reload();" class="icoBtn_ct"><span class="btnIco btnReload"></span>刷新</a> 
		<span class="split ftSplit" ></span>
	    <div id="guide">点击<span class="light_orange"> 订单详情 </span>进行查看</div>
		<%
			   Set rs = Server.CreateObject("ADODB.Recordset")
			   sql="select * from OrderSub order by id desc"
			   rs.open sql,conn,1,1
	    %>
	    <div class="pageInfo right light_gray">[当前共有<span id="Label_total_top" class="light_bOrange"><%=rs.recordcount%></span>条记录]</div>
    </div>
	<div id="MainContent">
<%if request("id")="" then%>	
	<form method="POST" id="form2" name="form2" action="">
     <table class="cTable table tCenter">
	    <tr class="cTitle toolbarBg" id="Title">
		    <td width="5%"><span class="checkbox">
	      <input type="checkbox" name="chkall" onClick="selcheck('MainContent')" /></span></td>
		    <td width="8%"><span class="split ctSplit"></span>
	      <div>ID</div></td>
	      <td width="13%"><span class="split ctSplit"></span>
          <div>预订者</div></td>
		    <td width="18%"><span class="split ctSplit"></span>
	        <div>预订类型</div></td>
		    <td width="20%"><span class="split ctSplit"></span>
	      <div>手机号码</div></td>
		    <td width="15%"><span class="split ctSplit"></span>
	      <div>预订日期</div></td>
		    <td width="8%"><span class="split ctSplit"></span>
	      <div><strong>详情</strong></div></td>
		    <td width="13%"><span class="split ctSplit"></span>
	      <div>确认操作</div></td>
	    </tr>
	    <%
		   rs.pagesize=14
		   curpage=Request.QueryString("curpage")
		   if curpage="" then curpage=1
		   if not rs.eof then rs.absolutepage=curpage
		   for i=1 to rs.pagesize
		   if rs.eof then
		   exit for
		   end if
	 %>
		<tr class="trDataList" onMouseOver="this.className='trDataListHover'" onMouseOut="this.className='trDataList'">
		  <td><input type="checkbox" name="chk" value="<%=rs("ID")%>" id="<%=rs("ID")%>" /></td>
		  <td><%=rs("ID")%></td>
		  <td><%=rs("name")%></td>
		  <td><%if rs("ordertype")="1" then response.Write("客房") else response.Write("餐饮") end if%></td>
		  <td><%=rs("mobile")%></td>
		  <td><%=rs("AddDate")%></td>
		  <td><a href='?ID=<%=rs("id")%>&curpage=<%=curpage%>'>详细资料</a></td>
		  <td><a href="?ID=<%=rs("ID")%>&action=Del" onClick="return confirm('确定删除？')">删除</a></td>
		</tr>
		<%
			rs.movenext
			next
        %>	
	</table>
	 
    <div id="cEndToolbar" class="toolbarBg">
        <div class="pageList">
				<%
				set pageObj=new pager
				response.Write pageObj.link(rs.recordcount,rs.pagesize,curpage,"?curpage=",qryString)
				%>
		<%
			rs.close
			Set rs=nothing
		 %>
	    </div>
	    <div class="pageSelect"><span class="iptSl"><input type="checkbox" name="chkall" onClick="selcheck('MainContent')" /></span><a href="javascript:selcheck('MainContent');"><span class="btnTxt">选择</span></a></div>
	    <span class="split cpSplit" ></span>
	    <div class="pageBtnDo">
	        <div class="icoBtn_do"><input type="image" name="Delete_Button" id="Delete_Button" class="btnIco btnDel" src="images/Empty.gif" onClick="document.form2.action='?action=delall';return confirm('确定要删除吗?');" style="border-width:0px;" /></div>
	    </div>
	</div>
	</form>
<%else%>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from ordersub where id="&ID
rs.open sql,conn,1,1
%>
 <table class="cTable_2 table">
  <tr class="cTitle toolbarBg">
    <td><div class="cLeftPadding">订单查看</div></td>
  </tr>
  <tr>
    <td><table width="90%" border="0" align="center" cellpadding="4" cellspacing="0">
                                  <tr>
                                    <td><span style="font-weight: bold">预订类型</span></td>
                                  </tr>
                                  <tr>
                                    <td><%if rs("ordertype")="1" then response.Write("客房") else response.Write("餐饮") end if%></td>
                                  </tr>
                                  <tr>
                                    <td><span style="font-weight: bold">预订信息</span></td>
                                  </tr>
                                  <tr>
                                    <td><table id="t1" <%if rs("ordertype")<>"1" then response.Write("style='display:none'")%> width="100%" border="0" cellspacing="0" cellpadding="4">
                                      <tr>
                                        <td width="17%" align="center">抵店时间</td>
                                        <td width="35%"><%=rs("startdate")%> <%=rs("starttime")%>
                                          *</td>
                                        <td width="16%" align="center">离店时间</td>
                                        <td width="32%"><%=rs("enddate")%> <%=rs("endtime")%>
*</td>
                                      </tr>
                                      <tr>
                                        <td align="center">房间类型</td>
                                        <td><%=rs("roomtype")%>                                        </td>
                                        <td align="center">房间数</td>
                                        <td><%=rs("roomsnum")%></td>
                                      </tr>

                                    </table>
                                      <table id="t2" <%if rs("ordertype")<>"2" then response.Write("style='display:none'")%> width="100%" border="0" cellspacing="0" cellpadding="4">
                                        <tr>
                                          <td width="17%" align="center">就餐时间</td>
                                          <td width="35%"><%=rs("eatdate")%> <%=rs("eattime")%>
										  *</td>
                                          <td width="16%" align="center">就餐人数</td>
                                          <td width="32%"><%=rs("peoplenum")%>*</td>
                                        </tr>
                                      </table></td>
                                  </tr>
                                  <tr>
                                    <td><span style="font-weight: bold">用户信息</span></td>
                                  </tr>
                                  <tr>
                                    <td><table width="100%" border="0" cellspacing="0" cellpadding="4">
                                      <tr>
                                        <td width="17%" align="center">您的姓名</td>
                                        <td width="35%"><%=rs("name")%> *</td>
                                        <td width="16%" align="center">联系电话</td>
                                        <td width="32%"><%=rs("tel")%></td>
                                      </tr>
                                      <tr>
                                        <td align="center">手机号码</td>
                                        <td><%=rs("mobile")%> *</td>
                                        <td align="center">E-mail:</td>
                                        <td><%=rs("email")%></td>
                                      </tr>

                                    </table></td>
                                  </tr>
                                  

      </table></td>
    </tr>
</table>
    <div id="cEndToolbar" class="toolbarBg">
      <div class="caButCase">
		    <input type="button" name="Submit2" value=" 返 回 " onClick="javascript:history.back()"  class="button">
      </div>
    </div>
<%rs.close
set rs=nothing%>  
<%end if%>		
    </div>
</body>
</html>